/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.b2b.modules.fm.service.base;

import java.util.List;

import com.b2b.common.utils.StringUtils;
import com.b2b.modules.fm.dao.base.FmStoreDao;
import com.b2b.modules.fm.entity.base.FmStore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.b2b.common.persistence.Page;
import com.b2b.common.service.CrudService;
import com.b2b.modules.fm.entity.base.FmEquipment;
import com.b2b.modules.fm.dao.base.FmEquipmentDao;

/**
 * 受控设备信息Service
 * @author soldier lee
 * @version 2016-11-20
 */
@Service
@Transactional(readOnly = true)
public class FmEquipmentService extends CrudService<FmEquipmentDao, FmEquipment> {
	@Autowired
	private FmStoreDao fmStoreDao;
	public FmEquipment get(String id) {
		FmEquipment fmEquipment = super.get(id);
		if (StringUtils.isNotEmpty(fmEquipment.getFmStore())){
			FmStore fmStore = this.fmStoreDao.findUniqueByProperty("sto002",fmEquipment.getFmStore().getSto002());
			fmEquipment.setFmStore(fmStore);
		}
		return super.get(id);
	}
	
	public List<FmEquipment> findList(FmEquipment fmEquipment) {
		return super.findList(fmEquipment);
	}
	
	public Page<FmEquipment> findPage(Page<FmEquipment> page, FmEquipment fmEquipment) {
		return super.findPage(page, fmEquipment);
	}
	
	@Transactional(readOnly = false)
	public void save(FmEquipment fmEquipment) {
		super.save(fmEquipment);
	}
	
	@Transactional(readOnly = false)
	public void delete(FmEquipment fmEquipment) {
		super.delete(fmEquipment);
	}
	
	
	
	
}